/* SV Nguyen Van Hoa
	ID: A05290
	class:T1209L
	program: EPC_Lab04	*/
	// Bai 08

#include"stdio.h"
#include"conio.h"
#include"math.h"
main()
{
	float a, b, c, x1, x2, delta;
	printf("\n Nhap vao he so a= ");
	scanf("%f",&a);fflush(stdin);
	printf("\n Nhap vao he so b= ");
	scanf("%f",&b);fflush(stdin);
	printf("\n Nhap vao he so c= ");
	scanf("%f",&c);fflush(stdin);
	if(a==0)
		printf("\n Day khong phai phuong trinh bac 2");
	else 
		{
			delta=b*b-4*a*c;
			if(delta<0)
				{
					printf("\n delta =%f",delta);
					printf("\n Phuong trinh vo nghiem");
					}
			else if(delta==0)
					{ 
						printf("\n delta=%f",delta);
						printf("\n Phuong trinh co nghiem kep x1=x2=%f",-b/2*a);
						}
			else
				{
					printf("\n delta=%f",delta);
					printf("\n Phuong trinh da cho co 2 nghiem phan biet la");
					printf("\n x1=%f",(-b-sqrt(delta))/2*a);
					printf("\n x2=%f",(-b+sqrt(delta)/2*a));
					}
				
				
			}
}
